<?php
	include("../includes/main_inc.php");
	
	
	if($_POST['Submit']){
		if($_POST['password']==$_POST['password2']){
			$m= new UpdateDatabase();
			$m->AddPosts($_POST,$_FILES);
			$m->AddSkip(array("id"));
			$m->AddTable("administrators");
			$m->AddID($_POST['id']);
			$m->DoStuff();
			$Message="Administrator Updated";
		};
	};
	
	if($_GET['id']) $id=$_GET['id'];
	elseif ($_POST['id']) $id=$_POST['id'];
	
	
	
	
	$r->AddTable("administrators");
	$r->AddSearchVar($id);
	$Insert=$r->GetRecord();
	

?><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Affiliate Bubble Administration</title>

<link href="<?=$rootdir?>css/admin.css" rel="stylesheet" type="text/css">
<script src="<?=$rootdir?>jscript/menuArray.js" language="javascript"></script>
<script src="<?=$rootdir?>jscript/clock.js" language="javascript"></script></head>

<body onLoad="funClock();">
<?php include("../includes/header.php"); ?>
<table width="100%" border="0" cellspacing="25" cellpadding="0">
<tr>
<td valign="top" width="240"><div id="menu">
  <?php include("../menu/administratorsmenu.php"); ?>
</div></td>
<td align="center" valign="top">

<div id="titleCompact"> Modify An Administrator
</div>

<div id="contentCompact">

<table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#E9EEF5">
<tr id="formHeader">
<td><strong>Update administrator details </strong><strong>below</strong></td>
</tr>
<tr>
  <td align="center" bgcolor="#FFFFFF"><form name="form1" method="post" action="modify.php"><?=$Message;?>
    <table width="400" border="0" cellspacing="0" cellpadding="4">
      <tr>
        <td width="130" height="30">Name:</td>
        <td width="354"><input name="name" type="text" class="formFields" id="name" value="<?=$Insert['name'];?>" size="40"></td>
      </tr>
      <tr>
        <td height="30">Email Address: </td>
        <td><input name="email" type="text" class="formFields" id="email" value="<?=$Insert['email'];?>" size="40"></td>
      </tr>
      <tr>
        <td height="30">Username:</td>
        <td><input name="username" type="text" class="formFields" id="username" value="<?=$Insert['username'];?>" size="40"></td>
      </tr>
      <tr>
        <td height="30">Password:</td>
        <td><input name="password" type="password" class="formFields" id="password" value="<?=$Insert['password'];?>" size="40"></td>
      </tr>
      <tr>
        <td height="30">Verfiy Password: </td>
        <td><input name="password2" type="password" class="formFields" id="password2" value="<?=$Insert['password'];?>" size="40"></td>
      </tr>
      <tr>
        <td><input name="id" type="hidden" id="id" value="<?=$id;?>"></td>
        <td><input type="submit" name="Submit" value="Modify Administrator" class="formButtonSubmit"></td>
      </tr>
    </table>
      </form>
  <a href="../members/search.php"></a></td>
</tr>
</table>

</div>

</td>
</tr>
</table>
</body>
</html>
